package com.atguigu.springcloud.alibaba.config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;

//@Configuration
public class GatewayConfig {
    @Bean
    public RouteLocator customRouteLocator(RouteLocatorBuilder builder) {
        return builder.routes()
                .route("route1",r -> r.path("/payment/get/**")

                        .uri("lb://cloud-payment-service")
                )

                .build();
    }
    @Bean
    public RouteLocator customRouteLocator2(RouteLocatorBuilder builder) {
        return builder.routes()
               .route("route2",r -> r.path("/payment/lb/**")

                        .uri("lb://cloud-payment-service")
                )

                .build();
    }
}
